/*
 * Copyright (c) 2000-2018, 达梦数据库有限公司.
 * All rights reserved.
 */
package dm

import (
	"bytes"
	"golang.org/x/text/encoding"
	"golang.org/x/text/encoding/ianaindex"
	"golang.org/x/text/transform"
	"io"
	"io/ioutil"
	"math"
)

type dm_build_1334 struct{}

var Dm_build_1335 = &dm_build_1334{}

func (Dm_build_1337 *dm_build_1334) Dm_build_1336(dm_build_1338 []byte, dm_build_1339 int, dm_build_1340 byte) int {
	dm_build_1338[dm_build_1339] = dm_build_1340
	return 1
}

func (Dm_build_1342 *dm_build_1334) Dm_build_1341(dm_build_1343 []byte, dm_build_1344 int, dm_build_1345 int8) int {
	dm_build_1343[dm_build_1344] = byte(dm_build_1345)
	return 1
}

func (Dm_build_1347 *dm_build_1334) Dm_build_1346(dm_build_1348 []byte, dm_build_1349 int, dm_build_1350 int16) int {
	dm_build_1348[dm_build_1349] = byte(dm_build_1350)
	dm_build_1349++
	dm_build_1348[dm_build_1349] = byte(dm_build_1350 >> 8)
	return 2
}

func (Dm_build_1352 *dm_build_1334) Dm_build_1351(dm_build_1353 []byte, dm_build_1354 int, dm_build_1355 int32) int {
	dm_build_1353[dm_build_1354] = byte(dm_build_1355)
	dm_build_1354++
	dm_build_1353[dm_build_1354] = byte(dm_build_1355 >> 8)
	dm_build_1354++
	dm_build_1353[dm_build_1354] = byte(dm_build_1355 >> 16)
	dm_build_1354++
	dm_build_1353[dm_build_1354] = byte(dm_build_1355 >> 24)
	dm_build_1354++
	return 4
}

func (Dm_build_1357 *dm_build_1334) Dm_build_1356(dm_build_1358 []byte, dm_build_1359 int, dm_build_1360 int64) int {
	dm_build_1358[dm_build_1359] = byte(dm_build_1360)
	dm_build_1359++
	dm_build_1358[dm_build_1359] = byte(dm_build_1360 >> 8)
	dm_build_1359++
	dm_build_1358[dm_build_1359] = byte(dm_build_1360 >> 16)
	dm_build_1359++
	dm_build_1358[dm_build_1359] = byte(dm_build_1360 >> 24)
	dm_build_1359++
	dm_build_1358[dm_build_1359] = byte(dm_build_1360 >> 32)
	dm_build_1359++
	dm_build_1358[dm_build_1359] = byte(dm_build_1360 >> 40)
	dm_build_1359++
	dm_build_1358[dm_build_1359] = byte(dm_build_1360 >> 48)
	dm_build_1359++
	dm_build_1358[dm_build_1359] = byte(dm_build_1360 >> 56)
	return 8
}

func (Dm_build_1362 *dm_build_1334) Dm_build_1361(dm_build_1363 []byte, dm_build_1364 int, dm_build_1365 float32) int {
	return Dm_build_1362.Dm_build_1381(dm_build_1363, dm_build_1364, math.Float32bits(dm_build_1365))
}

func (Dm_build_1367 *dm_build_1334) Dm_build_1366(dm_build_1368 []byte, dm_build_1369 int, dm_build_1370 float64) int {
	return Dm_build_1367.Dm_build_1386(dm_build_1368, dm_build_1369, math.Float64bits(dm_build_1370))
}

func (Dm_build_1372 *dm_build_1334) Dm_build_1371(dm_build_1373 []byte, dm_build_1374 int, dm_build_1375 uint8) int {
	dm_build_1373[dm_build_1374] = byte(dm_build_1375)
	return 1
}

func (Dm_build_1377 *dm_build_1334) Dm_build_1376(dm_build_1378 []byte, dm_build_1379 int, dm_build_1380 uint16) int {
	dm_build_1378[dm_build_1379] = byte(dm_build_1380)
	dm_build_1379++
	dm_build_1378[dm_build_1379] = byte(dm_build_1380 >> 8)
	return 2
}

func (Dm_build_1382 *dm_build_1334) Dm_build_1381(dm_build_1383 []byte, dm_build_1384 int, dm_build_1385 uint32) int {
	dm_build_1383[dm_build_1384] = byte(dm_build_1385)
	dm_build_1384++
	dm_build_1383[dm_build_1384] = byte(dm_build_1385 >> 8)
	dm_build_1384++
	dm_build_1383[dm_build_1384] = byte(dm_build_1385 >> 16)
	dm_build_1384++
	dm_build_1383[dm_build_1384] = byte(dm_build_1385 >> 24)
	return 3
}

func (Dm_build_1387 *dm_build_1334) Dm_build_1386(dm_build_1388 []byte, dm_build_1389 int, dm_build_1390 uint64) int {
	dm_build_1388[dm_build_1389] = byte(dm_build_1390)
	dm_build_1389++
	dm_build_1388[dm_build_1389] = byte(dm_build_1390 >> 8)
	dm_build_1389++
	dm_build_1388[dm_build_1389] = byte(dm_build_1390 >> 16)
	dm_build_1389++
	dm_build_1388[dm_build_1389] = byte(dm_build_1390 >> 24)
	dm_build_1389++
	dm_build_1388[dm_build_1389] = byte(dm_build_1390 >> 32)
	dm_build_1389++
	dm_build_1388[dm_build_1389] = byte(dm_build_1390 >> 40)
	dm_build_1389++
	dm_build_1388[dm_build_1389] = byte(dm_build_1390 >> 48)
	dm_build_1389++
	dm_build_1388[dm_build_1389] = byte(dm_build_1390 >> 56)
	return 3
}

func (Dm_build_1392 *dm_build_1334) Dm_build_1391(dm_build_1393 []byte, dm_build_1394 int, dm_build_1395 []byte, dm_build_1396 int, dm_build_1397 int) int {
	copy(dm_build_1393[dm_build_1394:dm_build_1394+dm_build_1397], dm_build_1395[dm_build_1396:dm_build_1396+dm_build_1397])
	return dm_build_1397
}

func (Dm_build_1399 *dm_build_1334) Dm_build_1398(dm_build_1400 []byte, dm_build_1401 int, dm_build_1402 []byte, dm_build_1403 int, dm_build_1404 int) int {
	dm_build_1401 += Dm_build_1399.Dm_build_1381(dm_build_1400, dm_build_1401, uint32(dm_build_1404))
	return 4 + Dm_build_1399.Dm_build_1391(dm_build_1400, dm_build_1401, dm_build_1402, dm_build_1403, dm_build_1404)
}

func (Dm_build_1406 *dm_build_1334) Dm_build_1405(dm_build_1407 []byte, dm_build_1408 int, dm_build_1409 []byte, dm_build_1410 int, dm_build_1411 int) int {
	dm_build_1408 += Dm_build_1406.Dm_build_1376(dm_build_1407, dm_build_1408, uint16(dm_build_1411))
	return 2 + Dm_build_1406.Dm_build_1391(dm_build_1407, dm_build_1408, dm_build_1409, dm_build_1410, dm_build_1411)
}

func (Dm_build_1413 *dm_build_1334) Dm_build_1412(dm_build_1414 []byte, dm_build_1415 int, dm_build_1416 string, dm_build_1417 string, dm_build_1418 *DmConnection) int {
	dm_build_1419 := Dm_build_1413.Dm_build_1551(dm_build_1416, dm_build_1417, dm_build_1418)
	dm_build_1415 += Dm_build_1413.Dm_build_1381(dm_build_1414, dm_build_1415, uint32(len(dm_build_1419)))
	return 4 + Dm_build_1413.Dm_build_1391(dm_build_1414, dm_build_1415, dm_build_1419, 0, len(dm_build_1419))
}

func (Dm_build_1421 *dm_build_1334) Dm_build_1420(dm_build_1422 []byte, dm_build_1423 int, dm_build_1424 string, dm_build_1425 string, dm_build_1426 *DmConnection) int {
	dm_build_1427 := Dm_build_1421.Dm_build_1551(dm_build_1424, dm_build_1425, dm_build_1426)

	dm_build_1423 += Dm_build_1421.Dm_build_1376(dm_build_1422, dm_build_1423, uint16(len(dm_build_1427)))
	return 2 + Dm_build_1421.Dm_build_1391(dm_build_1422, dm_build_1423, dm_build_1427, 0, len(dm_build_1427))
}

func (Dm_build_1429 *dm_build_1334) Dm_build_1428(dm_build_1430 []byte, dm_build_1431 int) byte {
	return dm_build_1430[dm_build_1431]
}

func (Dm_build_1433 *dm_build_1334) Dm_build_1432(dm_build_1434 []byte, dm_build_1435 int) int16 {
	var dm_build_1436 int16
	dm_build_1436 = int16(dm_build_1434[dm_build_1435] & 0xff)
	dm_build_1435++
	dm_build_1436 |= int16(dm_build_1434[dm_build_1435]&0xff) << 8
	return dm_build_1436
}

func (Dm_build_1438 *dm_build_1334) Dm_build_1437(dm_build_1439 []byte, dm_build_1440 int) int32 {
	var dm_build_1441 int32
	dm_build_1441 = int32(dm_build_1439[dm_build_1440] & 0xff)
	dm_build_1440++
	dm_build_1441 |= int32(dm_build_1439[dm_build_1440]&0xff) << 8
	dm_build_1440++
	dm_build_1441 |= int32(dm_build_1439[dm_build_1440]&0xff) << 16
	dm_build_1440++
	dm_build_1441 |= int32(dm_build_1439[dm_build_1440]&0xff) << 24
	return dm_build_1441
}

func (Dm_build_1443 *dm_build_1334) Dm_build_1442(dm_build_1444 []byte, dm_build_1445 int) int64 {
	var dm_build_1446 int64
	dm_build_1446 = int64(dm_build_1444[dm_build_1445] & 0xff)
	dm_build_1445++
	dm_build_1446 |= int64(dm_build_1444[dm_build_1445]&0xff) << 8
	dm_build_1445++
	dm_build_1446 |= int64(dm_build_1444[dm_build_1445]&0xff) << 16
	dm_build_1445++
	dm_build_1446 |= int64(dm_build_1444[dm_build_1445]&0xff) << 24
	dm_build_1445++
	dm_build_1446 |= int64(dm_build_1444[dm_build_1445]&0xff) << 32
	dm_build_1445++
	dm_build_1446 |= int64(dm_build_1444[dm_build_1445]&0xff) << 40
	dm_build_1445++
	dm_build_1446 |= int64(dm_build_1444[dm_build_1445]&0xff) << 48
	dm_build_1445++
	dm_build_1446 |= int64(dm_build_1444[dm_build_1445]&0xff) << 56
	return dm_build_1446
}

func (Dm_build_1448 *dm_build_1334) Dm_build_1447(dm_build_1449 []byte, dm_build_1450 int) float32 {
	return math.Float32frombits(Dm_build_1448.Dm_build_1464(dm_build_1449, dm_build_1450))
}

func (Dm_build_1452 *dm_build_1334) Dm_build_1451(dm_build_1453 []byte, dm_build_1454 int) float64 {
	return math.Float64frombits(Dm_build_1452.Dm_build_1469(dm_build_1453, dm_build_1454))
}

func (Dm_build_1456 *dm_build_1334) Dm_build_1455(dm_build_1457 []byte, dm_build_1458 int) uint8 {
	return uint8(dm_build_1457[dm_build_1458] & 0xff)
}

func (Dm_build_1460 *dm_build_1334) Dm_build_1459(dm_build_1461 []byte, dm_build_1462 int) uint16 {
	var dm_build_1463 uint16
	dm_build_1463 = uint16(dm_build_1461[dm_build_1462] & 0xff)
	dm_build_1462++
	dm_build_1463 |= uint16(dm_build_1461[dm_build_1462]&0xff) << 8
	return dm_build_1463
}

func (Dm_build_1465 *dm_build_1334) Dm_build_1464(dm_build_1466 []byte, dm_build_1467 int) uint32 {
	var dm_build_1468 uint32
	dm_build_1468 = uint32(dm_build_1466[dm_build_1467] & 0xff)
	dm_build_1467++
	dm_build_1468 |= uint32(dm_build_1466[dm_build_1467]&0xff) << 8
	dm_build_1467++
	dm_build_1468 |= uint32(dm_build_1466[dm_build_1467]&0xff) << 16
	dm_build_1467++
	dm_build_1468 |= uint32(dm_build_1466[dm_build_1467]&0xff) << 24
	return dm_build_1468
}

func (Dm_build_1470 *dm_build_1334) Dm_build_1469(dm_build_1471 []byte, dm_build_1472 int) uint64 {
	var dm_build_1473 uint64
	dm_build_1473 = uint64(dm_build_1471[dm_build_1472] & 0xff)
	dm_build_1472++
	dm_build_1473 |= uint64(dm_build_1471[dm_build_1472]&0xff) << 8
	dm_build_1472++
	dm_build_1473 |= uint64(dm_build_1471[dm_build_1472]&0xff) << 16
	dm_build_1472++
	dm_build_1473 |= uint64(dm_build_1471[dm_build_1472]&0xff) << 24
	dm_build_1472++
	dm_build_1473 |= uint64(dm_build_1471[dm_build_1472]&0xff) << 32
	dm_build_1472++
	dm_build_1473 |= uint64(dm_build_1471[dm_build_1472]&0xff) << 40
	dm_build_1472++
	dm_build_1473 |= uint64(dm_build_1471[dm_build_1472]&0xff) << 48
	dm_build_1472++
	dm_build_1473 |= uint64(dm_build_1471[dm_build_1472]&0xff) << 56
	return dm_build_1473
}

func (Dm_build_1475 *dm_build_1334) Dm_build_1474(dm_build_1476 []byte, dm_build_1477 int) []byte {
	dm_build_1478 := Dm_build_1475.Dm_build_1464(dm_build_1476, dm_build_1477)

	dm_build_1479 := make([]byte, dm_build_1478)
	copy(dm_build_1479[:int(dm_build_1478)], dm_build_1476[dm_build_1477+4:dm_build_1477+4+int(dm_build_1478)])
	return dm_build_1479
}

func (Dm_build_1481 *dm_build_1334) Dm_build_1480(dm_build_1482 []byte, dm_build_1483 int) []byte {
	dm_build_1484 := Dm_build_1481.Dm_build_1459(dm_build_1482, dm_build_1483)

	dm_build_1485 := make([]byte, dm_build_1484)
	copy(dm_build_1485[:int(dm_build_1484)], dm_build_1482[dm_build_1483+2:dm_build_1483+2+int(dm_build_1484)])
	return dm_build_1485
}

func (Dm_build_1487 *dm_build_1334) Dm_build_1486(dm_build_1488 []byte, dm_build_1489 int, dm_build_1490 int) []byte {

	dm_build_1491 := make([]byte, dm_build_1490)
	copy(dm_build_1491[:dm_build_1490], dm_build_1488[dm_build_1489:dm_build_1489+dm_build_1490])
	return dm_build_1491
}

func (Dm_build_1493 *dm_build_1334) Dm_build_1492(dm_build_1494 []byte, dm_build_1495 int, dm_build_1496 int, dm_build_1497 string, dm_build_1498 *DmConnection) string {
	return Dm_build_1493.Dm_build_1587(dm_build_1494[dm_build_1495:dm_build_1495+dm_build_1496], dm_build_1497, dm_build_1498)
}

func (Dm_build_1500 *dm_build_1334) Dm_build_1499(dm_build_1501 []byte, dm_build_1502 int, dm_build_1503 string, dm_build_1504 *DmConnection) string {
	dm_build_1505 := Dm_build_1500.Dm_build_1464(dm_build_1501, dm_build_1502)
	dm_build_1502 += 4
	return Dm_build_1500.Dm_build_1492(dm_build_1501, dm_build_1502, int(dm_build_1505), dm_build_1503, dm_build_1504)
}

func (Dm_build_1507 *dm_build_1334) Dm_build_1506(dm_build_1508 []byte, dm_build_1509 int, dm_build_1510 string, dm_build_1511 *DmConnection) string {
	dm_build_1512 := Dm_build_1507.Dm_build_1459(dm_build_1508, dm_build_1509)
	dm_build_1509 += 2
	return Dm_build_1507.Dm_build_1492(dm_build_1508, dm_build_1509, int(dm_build_1512), dm_build_1510, dm_build_1511)
}

func (Dm_build_1514 *dm_build_1334) Dm_build_1513(dm_build_1515 byte) []byte {
	return []byte{dm_build_1515}
}

func (Dm_build_1517 *dm_build_1334) Dm_build_1516(dm_build_1518 int8) []byte {
	return []byte{byte(dm_build_1518)}
}

func (Dm_build_1520 *dm_build_1334) Dm_build_1519(dm_build_1521 int16) []byte {
	return []byte{byte(dm_build_1521), byte(dm_build_1521 >> 8)}
}

func (Dm_build_1523 *dm_build_1334) Dm_build_1522(dm_build_1524 int32) []byte {
	return []byte{byte(dm_build_1524), byte(dm_build_1524 >> 8), byte(dm_build_1524 >> 16), byte(dm_build_1524 >> 24)}
}

func (Dm_build_1526 *dm_build_1334) Dm_build_1525(dm_build_1527 int64) []byte {
	return []byte{byte(dm_build_1527), byte(dm_build_1527 >> 8), byte(dm_build_1527 >> 16), byte(dm_build_1527 >> 24), byte(dm_build_1527 >> 32),
		byte(dm_build_1527 >> 40), byte(dm_build_1527 >> 48), byte(dm_build_1527 >> 56)}
}

func (Dm_build_1529 *dm_build_1334) Dm_build_1528(dm_build_1530 float32) []byte {
	return Dm_build_1529.Dm_build_1540(math.Float32bits(dm_build_1530))
}

func (Dm_build_1532 *dm_build_1334) Dm_build_1531(dm_build_1533 float64) []byte {
	return Dm_build_1532.Dm_build_1543(math.Float64bits(dm_build_1533))
}

func (Dm_build_1535 *dm_build_1334) Dm_build_1534(dm_build_1536 uint8) []byte {
	return []byte{byte(dm_build_1536)}
}

func (Dm_build_1538 *dm_build_1334) Dm_build_1537(dm_build_1539 uint16) []byte {
	return []byte{byte(dm_build_1539), byte(dm_build_1539 >> 8)}
}

func (Dm_build_1541 *dm_build_1334) Dm_build_1540(dm_build_1542 uint32) []byte {
	return []byte{byte(dm_build_1542), byte(dm_build_1542 >> 8), byte(dm_build_1542 >> 16), byte(dm_build_1542 >> 24)}
}

func (Dm_build_1544 *dm_build_1334) Dm_build_1543(dm_build_1545 uint64) []byte {
	return []byte{byte(dm_build_1545), byte(dm_build_1545 >> 8), byte(dm_build_1545 >> 16), byte(dm_build_1545 >> 24), byte(dm_build_1545 >> 32), byte(dm_build_1545 >> 40), byte(dm_build_1545 >> 48), byte(dm_build_1545 >> 56)}
}

func (Dm_build_1547 *dm_build_1334) Dm_build_1546(dm_build_1548 []byte, dm_build_1549 string, dm_build_1550 *DmConnection) []byte {
	if dm_build_1549 == "UTF-8" {
		return dm_build_1548
	}

	if dm_build_1550 == nil {
		if e := dm_build_1592(dm_build_1549); e != nil {
			tmp, err := ioutil.ReadAll(
				transform.NewReader(bytes.NewReader(dm_build_1548), e.NewEncoder()),
			)
			if err != nil {
				panic("UTF8 To Charset error!")
			}

			return tmp
		}

		panic("Unsupported Charset!")
	}

	if dm_build_1550.encodeBuffer == nil {
		dm_build_1550.encodeBuffer = bytes.NewBuffer(nil)
		dm_build_1550.encode = dm_build_1592(dm_build_1550.getServerEncoding())
		dm_build_1550.transformReaderDst = make([]byte, 4096)
		dm_build_1550.transformReaderSrc = make([]byte, 4096)
	}

	if e := dm_build_1550.encode; e != nil {

		dm_build_1550.encodeBuffer.Reset()

		n, err := dm_build_1550.encodeBuffer.ReadFrom(
			Dm_build_1606(bytes.NewReader(dm_build_1548), e.NewEncoder(), dm_build_1550.transformReaderDst, dm_build_1550.transformReaderSrc),
		)
		if err != nil {
			panic("UTF8 To Charset error!")
		}
		var tmp = make([]byte, n)
		if _, err = dm_build_1550.encodeBuffer.Read(tmp); err != nil {
			panic("UTF8 To Charset error!")
		}
		return tmp
	}

	panic("Unsupported Charset!")
}

func (Dm_build_1552 *dm_build_1334) Dm_build_1551(dm_build_1553 string, dm_build_1554 string, dm_build_1555 *DmConnection) []byte {
	return Dm_build_1552.Dm_build_1546([]byte(dm_build_1553), dm_build_1554, dm_build_1555)
}

func (Dm_build_1557 *dm_build_1334) Dm_build_1556(dm_build_1558 []byte) byte {
	return Dm_build_1557.Dm_build_1428(dm_build_1558, 0)
}

func (Dm_build_1560 *dm_build_1334) Dm_build_1559(dm_build_1561 []byte) int16 {
	return Dm_build_1560.Dm_build_1432(dm_build_1561, 0)
}

func (Dm_build_1563 *dm_build_1334) Dm_build_1562(dm_build_1564 []byte) int32 {
	return Dm_build_1563.Dm_build_1437(dm_build_1564, 0)
}

func (Dm_build_1566 *dm_build_1334) Dm_build_1565(dm_build_1567 []byte) int64 {
	return Dm_build_1566.Dm_build_1442(dm_build_1567, 0)
}

func (Dm_build_1569 *dm_build_1334) Dm_build_1568(dm_build_1570 []byte) float32 {
	return Dm_build_1569.Dm_build_1447(dm_build_1570, 0)
}

func (Dm_build_1572 *dm_build_1334) Dm_build_1571(dm_build_1573 []byte) float64 {
	return Dm_build_1572.Dm_build_1451(dm_build_1573, 0)
}

func (Dm_build_1575 *dm_build_1334) Dm_build_1574(dm_build_1576 []byte) uint8 {
	return Dm_build_1575.Dm_build_1455(dm_build_1576, 0)
}

func (Dm_build_1578 *dm_build_1334) Dm_build_1577(dm_build_1579 []byte) uint16 {
	return Dm_build_1578.Dm_build_1459(dm_build_1579, 0)
}

func (Dm_build_1581 *dm_build_1334) Dm_build_1580(dm_build_1582 []byte) uint32 {
	return Dm_build_1581.Dm_build_1464(dm_build_1582, 0)
}

func (Dm_build_1584 *dm_build_1334) Dm_build_1583(dm_build_1585 []byte, dm_build_1586 string) []byte {
	if dm_build_1586 == "UTF-8" {
		return dm_build_1585
	}

	if e := dm_build_1592(dm_build_1586); e != nil {

		tmp, err := ioutil.ReadAll(
			transform.NewReader(bytes.NewReader(dm_build_1585), e.NewDecoder()),
		)
		if err != nil {

			panic("Charset To UTF8 error!")
		}

		return tmp
	}

	panic("Unsupported Charset!")

}

func (Dm_build_1588 *dm_build_1334) Dm_build_1587(dm_build_1589 []byte, dm_build_1590 string, dm_build_1591 *DmConnection) string {
	return string(Dm_build_1588.Dm_build_1583(dm_build_1589, dm_build_1590))
}

func dm_build_1592(dm_build_1593 string) encoding.Encoding {
	if e, err := ianaindex.MIB.Encoding(dm_build_1593); err == nil && e != nil {
		return e
	}
	return nil
}

type Dm_build_1594 struct {
	dm_build_1595 io.Reader
	dm_build_1596 transform.Transformer
	dm_build_1597 error

	dm_build_1598                []byte
	dm_build_1599, dm_build_1600 int

	dm_build_1601                []byte
	dm_build_1602, dm_build_1603 int

	dm_build_1604 bool
}

const dm_build_1605 = 4096

func Dm_build_1606(dm_build_1607 io.Reader, dm_build_1608 transform.Transformer, dm_build_1609 []byte, dm_build_1610 []byte) *Dm_build_1594 {
	dm_build_1608.Reset()
	return &Dm_build_1594{
		dm_build_1595: dm_build_1607,
		dm_build_1596: dm_build_1608,
		dm_build_1598: dm_build_1609,
		dm_build_1601: dm_build_1610,
	}
}

func (dm_build_1612 *Dm_build_1594) Read(dm_build_1613 []byte) (int, error) {
	dm_build_1614, dm_build_1615 := 0, error(nil)
	for {

		if dm_build_1612.dm_build_1599 != dm_build_1612.dm_build_1600 {
			dm_build_1614 = copy(dm_build_1613, dm_build_1612.dm_build_1598[dm_build_1612.dm_build_1599:dm_build_1612.dm_build_1600])
			dm_build_1612.dm_build_1599 += dm_build_1614
			if dm_build_1612.dm_build_1599 == dm_build_1612.dm_build_1600 && dm_build_1612.dm_build_1604 {
				return dm_build_1614, dm_build_1612.dm_build_1597
			}
			return dm_build_1614, nil
		} else if dm_build_1612.dm_build_1604 {
			return 0, dm_build_1612.dm_build_1597
		}

		if dm_build_1612.dm_build_1602 != dm_build_1612.dm_build_1603 || dm_build_1612.dm_build_1597 != nil {
			dm_build_1612.dm_build_1599 = 0
			dm_build_1612.dm_build_1600, dm_build_1614, dm_build_1615 = dm_build_1612.dm_build_1596.Transform(dm_build_1612.dm_build_1598, dm_build_1612.dm_build_1601[dm_build_1612.dm_build_1602:dm_build_1612.dm_build_1603], dm_build_1612.dm_build_1597 == io.EOF)
			dm_build_1612.dm_build_1602 += dm_build_1614

			switch {
			case dm_build_1615 == nil:
				if dm_build_1612.dm_build_1602 != dm_build_1612.dm_build_1603 {
					dm_build_1612.dm_build_1597 = nil
				}

				dm_build_1612.dm_build_1604 = dm_build_1612.dm_build_1597 != nil
				continue
			case dm_build_1615 == transform.ErrShortDst && (dm_build_1612.dm_build_1600 != 0 || dm_build_1614 != 0):

				continue
			case dm_build_1615 == transform.ErrShortSrc && dm_build_1612.dm_build_1603-dm_build_1612.dm_build_1602 != len(dm_build_1612.dm_build_1601) && dm_build_1612.dm_build_1597 == nil:

			default:
				dm_build_1612.dm_build_1604 = true

				if dm_build_1612.dm_build_1597 == nil || dm_build_1612.dm_build_1597 == io.EOF {
					dm_build_1612.dm_build_1597 = dm_build_1615
				}
				continue
			}
		}

		if dm_build_1612.dm_build_1602 != 0 {
			dm_build_1612.dm_build_1602, dm_build_1612.dm_build_1603 = 0, copy(dm_build_1612.dm_build_1601, dm_build_1612.dm_build_1601[dm_build_1612.dm_build_1602:dm_build_1612.dm_build_1603])
		}
		dm_build_1614, dm_build_1612.dm_build_1597 = dm_build_1612.dm_build_1595.Read(dm_build_1612.dm_build_1601[dm_build_1612.dm_build_1603:])
		dm_build_1612.dm_build_1603 += dm_build_1614
	}
}
